import java.util.Scanner;

/**
 * @Author wonghiu
 * @Date 2021/8/8 19:25
 * @Version 1.0.1
 */
public class pdd22 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int maxTarget = sc.nextInt();
        int total = sc.nextInt();
        int count = 0;
        int res = 0;

        for (int k = 0; k < n; k++) {
            int cur = sc.nextInt();
            // 大于目标值，则停下，进行处理
            if (cur>maxTarget){
                // 小于目标值的已经够total,则可进行统计
                if (count>=total){
                    res+=count-total+1;
                }
                // 重新计数
                count=0;
            }else {
                count++;
            }
        }
        res+=count-total+1;
        System.out.println(res);
    }
}
